#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <assert.h>
const char* my_strstr(const char*str1,const char*str2)
{
	assert(str1 && str2);
	const char* s1 = NULL;
	const char* s2 = NULL;
	const char* cur = NULL;
	cur = str1;
	while (*cur != '\0')
	{
		s2 = str2;
		s1 = cur;
		while(*s1 == *s2&&*s1&&*s2)
		{
			s1++;
			s2++;
		}
		if (*s2 == '\0')
		{
			return cur;
		}
		cur++;
	}
	if (*cur == '\0')
		return NULL;
}
int main()
{
	char arr[] = "abbbcdefabcdef";
	char* p = "bbc";
	char* ret = my_strstr(arr, p);
	printf("%s", ret);
	return 0;
}